package com.changgou.goods.feign;


import com.changgou.common.pojo.Result;
import com.changgou.goods.pojo.pojo.Sku;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;
import java.util.Map;


@FeignClient(name = "goods")
@RequestMapping("/sku")
public interface SkuFeign {
    /**
     * 查询sku的列表
     * @return
     */
    @GetMapping
    Result<List<Sku>> findAll();

    /**
     * 根据商品id查询商品信息
     * @param id
     * @return
     */
    @GetMapping("/{id}")
    Result<Sku> findById(@PathVariable Long id);

    /**
     * 商品的递减
     * @param decrMap
     * @return
     */
    @GetMapping("/decr/count")
    Result decrCopunt(@RequestParam Map<String,Integer> decrMap);
}
